home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / dev / cross / ava-0.2.5.lha / ava-0.2.5 / avalib / avr / 1200def.inc next >
Encoding:
Text File  |  1999-03-23  |  2.9 KB  |  147 lines

  1. ;***************************************************************************
  2. ;* A P P L I C A T I O N   N O T E   F O R   T H E   A V R   F A M I L Y
  3. ;* 
  4. ;* Number        :AVR000
  5. ;* File Name        :"1200def.inc"
  6. ;* Title        :Register/Bit Definitions for the AT90S1200
  7. ;* Date             :97.12.11
  8. ;* Version        :1.22
  9. ;* Target MCU        :AT90S1200
  10. ;*
  11. ;* DESCRIPTION
  12. ;* When including this file in the assembly program file, all I/O register
  13. ;* names and I/O register bit names appearing in the data book can be used.
  14. ;* 
  15. ;* The Register names are represented by their hexadecimal addresses.
  16. ;* 
  17. ;* The Register Bit names are represented by their bit number (0-7).
  18. ;* 
  19. ;* Please observe the difference in using the bit names with instructions
  20. ;* such as "sbr"/"cbr" (set/clear bit in register) and "sbrs"/"sbrc" 
  21. ;* (skip if bit in register set/cleared). The following example illustrates
  22. ;* this:
  23. ;* 
  24. ;* in    r16,PORTB        ;read PORTB latch
  25. ;* sbr    r16,(1<<PB6)+(1<<PB5)    ;set PB6 and PB5 (use masks, not bit#)
  26. ;* out  PORTB,r16        ;output to PORTB
  27. ;*
  28. ;* in    r16,TIFR        ;read the Timer Interrupt Flag Register
  29. ;* sbrc    r16,TOV0        ;test the overflow flag (use bit#)
  30. ;* rjmp    TOV0_is_set        ;jump if set
  31. ;* ...                ;otherwise do something else
  32. ;***************************************************************************
  33.  
  34. ;***** I/O Register Definitions
  35. #define    SREG     $3f
  36. #define    GIMSK     $3b
  37. #define    TIMSK     $39
  38. #define    TIFR     $38
  39. #define    MCUCR     $35
  40. #define    TCCR0     $33
  41. #define    TCNT0     $32
  42. #define    WDTCR     $21
  43. #define    EEAR     $1e
  44. #define    EEDR     $1d
  45. #define    EECR     $1c
  46. #define    PORTB     $18
  47. #define    DDRB     $17
  48. #define    PINB     $16
  49. #define    PORTD     $12
  50. #define    DDRD     $11
  51. #define    PIND     $10
  52. #define    ACSR     $08
  53.  
  54. ;***** Bit Definitions
  55.  
  56. #define    INT0     6
  57.  
  58. #define    TOIE0     1
  59.  
  60. #define    TOV0     1
  61.  
  62. #define    SE     5
  63. #define    SM     4
  64. #define    ISC01     1
  65. #define    ISC00     0
  66.  
  67. #define    CS02     2
  68. #define    CS01     1
  69. #define    CS00     0
  70.  
  71. #define    WDE     3
  72. #define    WDP2     2
  73. #define    WDP1     1
  74. #define    WDP0     0
  75.  
  76. #define    EEWE     1
  77. #define    EERE     0
  78.  
  79. #define    PB7     7
  80. #define    PB6     6
  81. #define    PB5     5
  82. #define    PB4     4
  83. #define    PB3     3
  84. #define    PB2     2
  85. #define    PB1     1
  86. #define    PB0     0
  87.  
  88. #define    DDB7     7
  89. #define    DDB6     6
  90. #define    DDB5     5
  91. #define    DDB4     4
  92. #define    DDB3     3
  93. #define    DDB2     2
  94. #define    DDB1     1
  95. #define    DDB0     0
  96.  
  97. #define    PINB7     7
  98. #define    PINB6     6
  99. #define    PINB5     5
  100. #define    PINB4     4
  101. #define    PINB3     3
  102. #define    PINB2     2
  103. #define    PINB1     1
  104. #define    PINB0     0
  105.  
  106. #define    PD6     6
  107. #define    PD5     5
  108. #define    PD4     4
  109. #define    PD3     3
  110. #define    PD2     2
  111. #define    PD1     1
  112. #define    PD0     0
  113.  
  114. #define    DDD6     6
  115. #define    DDD5     5
  116. #define    DDD4     4
  117. #define    DDD3     3
  118. #define    DDD2     2
  119. #define    DDD1     1
  120. #define    DDD0     0
  121.  
  122. #define    PIND6     6
  123. #define    PIND5     5
  124. #define    PIND4     4
  125. #define    PIND3     3
  126. #define    PIND2     2
  127. #define    PIND1     1
  128. #define    PIND0     0
  129.  
  130. #define    ACD     7
  131. #define    ACO     5
  132. #define    ACI     4
  133. #define    ACIE     3
  134. #define    ACIS1     1
  135. #define    ACIS0     0
  136.  
  137. #define    XRAMEND  $0
  138. #define    E2END     $3F
  139. #define    FLASHEND $1FF
  140.  
  141. #define    INT0addr $001    ;External Interrupt0 Vector Address
  142. #define    OVF0addr $002    ;Overflow0 Interrupt Vector Address
  143. #define    ACIaddr  $003    ;Analog Comparator Interrupt Vector Address
  144.  
  145. #define    ZL     r30
  146.  
  147.